#include "BeforeConnOriDispatcher.h"
#include "BeginConnectOriDestHandler.h"
#include "BeginConnInsDestHandler.h"
#include "InsteadHttpUrl.h"

using namespace std;

ITransHandler::ExecuteResultCode BeforeConnOriDispatcher::PreExecute(ClientContext &client,OVERLAPPED *ovl,DWORD *transCount)
{
	return ITransHandler::ExecuteOK;
}

ITransHandler* BeforeConnOriDispatcher::HitFailedHandler()
{
	return new BeginConnectOriDestHandler();
}

ITransHandler* BeforeConnOriDispatcher::HittedHandler(const string &hittedUrl,DWORD transCount)
{
	InsteadHttpUrl url=hittedUrl;
	return new BeginConnInsDestHandler(url);
}